home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1998 March
/
Software of the Month Club 1998 March.iso
/
pc
/
win
/
edu
/
abepsf22
/
abepsf22.txt
< prev
next >
Wrap
Text File
|
1997-11-12
|
27KB
|
468 lines
This file is AbePSF22.txt. It contains five sections that
describe version 2.0 of the Abe_PSF2 code for IBM PC
computers and compatibles running 32-bit Windows operating
systems:
Section 1: A brief description of the Abe_PSF2 computer
program, in the format typically used for upload announcements.
Section 2: A more detailed description of the computer program.
Section 3: A "walk through" to make your first use of this
computer program a success, and maybe even fun.
Section 4: A history of the Abe_PSF code.
Section 5: Brief remarks on the branch of physics called optics.
__________ Section 1: Brief description _____________
Abe_PSF2 replaces all versions of its predecessor,
Abe_PSF.
Abe_PSF2 is a 32-bit Windows PC program that shows
how the wavefront shape and the transmission function of an
optical system will affect its image blur, formally called the point
spread function (PSF). The image degradation from wavefront
effects such as third order aberrations (coma, spherical,
astigmatism) and defocus, Zernike polynomial coefficients,
discontinuous phase errors (waffle, checkerboard, or random),
and/or a subaperture phase plate are simulated. The blur
growth from the transmission losses due to obscurations from
secondary mirror struts or a central obscuration are modeled, as
well as apodization effects or speckle. The pupil can be round,
hexagonal, or rectangular, and the system wavelength and
f/number are user selectable. All effects may be simulated
independently or in combination.
Screen output is in tabular or graphical form; 2-D or 3-D
plots of PSF or logarithm PSF (to show low intensity detail) are
possible. An ASCII file containing pupil transmission, pupil
phase, or PSF modulus values can be saved and imported into
other programs. The graphical user interface is intuitive and
straightforward. This program should be of interest to high
school or college teachers or students who are interested in
science, optics or astronomy, as well as optics professionals.
Download the compressed binary file, called
abepsf22.zip, which contains the executable code, a utility, and a
text file with brief and detailed descriptions and a "walkthrough"
for those unfamiliar with pupil functions and diffraction point
spread functions.
Special requirements: 32-bit Windows (Windows 95,
Windows NT, or Win 3.11 w/ Win32s)
Abepsf22.zip corrects a bug that caused program aborts
under Win95; Abe_PSF2 replaces all versions of Abe_PSF,
which have date stamps earlier than August, 1997.
ShareWare. $10. Uploaded by the author
Nelson Wallace user702495@aol.com
_______ Section 2: More Detailed Description _________
The point spread function (PSF) is the diffraction based
image of a point object as formed in the focal plane of an optic.
This image will be affected by how the optic changes the
wavefront phase and transmission. Abe_PSF2 models those
effects in a 128 by 128 array of complex numbers and performs
a two-dimensional fast fourier transform (FFT) to compute the
PSF from the pupil function.
Abe_PSF2 is an optics computer program for the IBM PC
and compatible computers running under 32 bit Windows
(Win32s or Win95 or NT). The program calculates the diffraction
PSF of either a perfect wavefront or of a wavefront containing a
combination of small amounts of pupil phase error, including
third order aberration, defocus, Zernike phase aberrations, and
discontinuous phase errors such as waffle, random, or
checkerboard phase errors. A subaperture phase plate can be
used to give a step phase change over a fraction of the pupil.
The pupil may be round, hexagonal, or rectangular, and also
may be modeled with a circular central obscuration or not, as
well as an apodized or unapodized transmission. The pupil
transmission apodization function can be triangular, gaussian, or
supergaussian. The pupil can also exhibit the shadows
associated with secondary mirror struts, and can have the
varying irradiance across it caused by speckle. The wavelength
and pupil diameter can be varied.
In Abe_PSF2, the aberrations and pupil transmissions
can be modeled individually or in combination. Optics textbooks
often show the geometrical spots for aberrations, but not usually
the diffraction PSFs, and certainly not the situation where
several aberrations are together in combination, which is the
usual case in practice; Abe_PSF2 can model a wide range of
combined effects. The Windows graphical user interface (GUI)
makes the selection of optical system and wavefront parameters
easy.
The third order aberrations that are modeled include
spherical, coma, and astigmatism. Defocus is also modeled;
defocus can occur both from field curvature, which is a third
order aberration, or from a focal plane shift. The aberration
called distortion will cause point images to appear in the wrong
place on the focal plane, but will not increase the blur; for this
reason, distortion effects are not modeled in this code. The
magnitude of each aberration is specified in terms of
wavelengths of optical path difference (OPD) at the edge of the
pupil. The field of view for asymmetric aberrations (coma and
astigmatism) can be oriented either horizontally (x) or vertically
(y). Complex wavefronts represented by the thirty seven
"Fringe" Zernike polynomial coefficients can also be modeled.
The transmission of an unapodized pupil is 100%. If
something obscures a portion of the pupil (i.e., blocks the light in
a portion of it), the transmission of the obscured area is zero.
The program allows for either an unobscured or a centrally
obscured pupil. The obscuration is specified in terms of the
linear obscuration ratio, which is the ratio of the diameter of the
obscuration to the diameter of the pupil. A value of one for the
obscuration ratio would correspond to a completely obscured
aperture for which no light would get to the image. Typical linear
obscuration ratios range from 0.1 to 0.3.
Abe_PSF2 can also model pupils whose transmission is
apodized. The usual case is without apodization, where the
transmission in the pupil region is 100% on the open
(unobscured) area, and 0 % outside the pupil. An apodized pupil
has regions in the clear area where the transmission is less than
100% but more than zero. Abe_PSF2 models either a triangular
(cone shaped) or a supergausian transmission apodization
function. A supergaussian function "cuts off" more quickly as the
supergaussian coefficient increases; a supergaussian coefficient
of around 4 or 5 gives a nearly "flat top" or "pillbox" transmission
function. Later, in the "walkthrough" section that follows, you'll
see how to do a 3-D plot of pupil transmission to see what the
apodization looks like.
Checkboxes and radio buttons in the setup dialog boxes
determine whether the aberrations, obscurations, Zernike
coefficients, apodizations, supergaussians, discontinuous phase
functions and phase plates will be applied to the wavefront or
not. When a setup dialog box is closed by the "Okay" button, a
new pupil function is generated and the old PSF is discarded.
However, a new PSF is not automatically generated, since
several other pupil changes might be specified for the new
system. It will be necessary to click on the "Create PSF" menu
item in order to generate the point spread function after all of the
new pupil information has been input. If you request PSF
information when you have forgotten to generate the new PSF,
the code will present a message box that tells you how to do the
PSF.
Abe_PSF2 has both graphical and tabular displays of the
input wavefront transmission, the input wavefront phase, and the
output PSF. On-screen graphics show 2-D plots (also called
"slices"), or 3 dimensional isometric plots or contour plots for
each of these three data sets. An ASCII file can be written with
the pupil phase, pupil transmission, or the PSF array values;
these can then be imported into another program (MS Excel, for
example) for further manipulation and graphics hardcopy.
Abe_PSF2 is a 32 bit program. It runs under Windows
3.1X with the help of Win32s, and it also runs under Windows 95
or NT. Be sure that the file CW3215.DLL is either in the same
directory as the code, or is on a path. The file AbePSF22.ZIP
contains several files: Version 1 of Abe_PSF2.EXE,
AbePSF22.TXT (this file), and CW3220.DLL.
Abe_PSF2 is copyright Nelson Wallace, 1995-7. It is a
ShareWare program and may be found at:
ftp://lorien.creol.ucf.edu/pub/optics
ftp://ftp.osa.org/OptSoft/freeSoft
Check the CREOL site for the latest upgrades.
_____ Section 3: Walkthrough ____________________
(You may want to print this part of the file and keep it
handy as you run the program for the first time).
This walkthrough will show you how to review the default
pupil function that is always created upon the start-up of the
computer program. It will also tell you how to create and review
the PSF that results from the pupil function. It ends with
suggestions of other things to try.
Unzip the Abe_PSF22.ZIP file. Make a directory on your
hard drive called "Abe_PSF2" and copy all of the files (.exe, .dll,.
txt, etc.) into it. Then make sure you can see the .exe extension
on your files. To do this, open Windows Explorer, click on the
View menu item, then click on the Options submenu. When the
Options dialog box opens, click on the View tab. Make sure the
checkbox for the "Hide MS-DOS file extensions for file types that
are registered" is not checked. Close the options dialog box.
Now you can see the full filename. You could create a shortcut
of Abe_PSF2.exe and drag it onto your desktop. Or, In
Windows Explorer, find the Abe_PSF2 subdirectory, and double
click on the Abe_PSF2.exe file.
This begins the program. The program uses the full
screen, displaying a menu at the top. Let's take a tour of the
general optics setup first. Click on the "Setup" toplevel menu
item. You'll see four submenu items. Click on "System
Specifications", and then on the "Optics Specifications" menu
item. An optics specifications dialog box opens, showing that
the analysis wavelength is 500.000 nanometers, and that the
optics f/number is f/5.600. It also shows that the field of view for
the third order aberrations is in the horizontal, or x direction. You
can click on "Cancel" or "OK" to close this box. Clicking on "OK"
will cause the program to accept the values shown as input, and
to recalculate the pupil function (and this could take some time
on slower machines); if you click on "Cancel", the program will
keep the values it already had, and not recompute the pupil
function; this choice is faster when reviewing data that does not
need to be changed.
Click on the "Setup", "System Specifications" and "Pupil
Specifications" menu items. The pupil specifications dialog box
opens, showing that the pupil shape can either be round,
hexagonal, or rectangular; in the current setup, the exit pupil is
seen to be round, with a diameter of 10.00 millimeters. Click on
"Cancel" to close this box.
The program is designed to combine different pupil phase
effects and transmission effects. Let's look at how the pupil
phase is specified as the sum of four effects: third order
aberrations, Zernike terms, a discontinuous phase pattern,
and/or a subaperture phase plate.
Click on the "Setup", "Pupil Phase", and the "Third Order
Aberrations" menu items. A third order aberrations dialog box
opens. Notice that this dialog box has a check in the checkbox
for coma, showing that the coma aberration is enabled. Note
that none of the other checkboxes are checked; none of these
other aberrations will be added in to the pupil phase, even if
there were numerical values in the boxes next to the
checkboxes. The number "-0.400" appears in the number field
next to the coma checkbox; this means the coma will be 0.4
waves at the edge of the pupil. Because coma is an asymmetric
aberration, the aberration at one edge on the pupil will be 0.4
waves forward, and 0.4 waves backward at the other edge of the
pupil. The minus sign in the -0.4 value shown determines
whether the forward phase error occurs on the left or the right of
the pupil. Click on the "Cancel" button to close the third order
aberrations dialog box.
Click on the toplevel menu item "Setup", and "Pupil
Phase" again, then "Zernike Coefficients". A Zernike coefficients
dialog box opens. In the upper right-hand corner of this dialog
box, there is a check in the checkbox that controls the 26th
Zernike coefficient, showing that this phase aberration is
enabled. All the other terms are turned off because their
checkboxes are not checked. Click on the "Cancel" button to
close the Zernike coefficients dialog box.
Click on the toplevel menu item "Setup", "Pupil Phase",
then "Discontinuous Phase Pattern". The discontinuous phase
pattern dialog box opens, giving choices for the type of pattern,
which are either none, a checker board, a waffle, or a random
pattern. For the default condition, there is no contribution to the
pupil phase from a discontinuous phase pattern. In this dialog
box, it is also possible to define the amplitude of the phase
pattern, in waves, and to specify the pattern's period. Click on
the "Cancel" button to close the discontinuous phase pattern
dialog box.
Click on the toplevel menu item "Setup", "Pupil Phase"
again, then "Subaperture Phase Plate". Until now, all of the
phase functions that were specified pertained to the entire pupil;
the subaperture phase plate allows the user to apply a step in
phase over a fraction of the aperture. The default condition is to
have the "enabled" checkbox unchecked, thus disabling this
feature; if it were enabled, the default numerical values would
give a half-wave phase step would be applied over half of the
aperture. As the dialog box shows, the size of the step (in
waves) and the edge location (in pixels) are user selectable.
Click on the "Cancel" button to close the subaperture phase
plate dialog box.
You've now seen all of the pupil phase effects. Next let's
look at tailoring the pupil transmission by apodizing the
transmission and/or adding obscurations.
Click on the toplevel menu item "Setup", "Pupil
Transmission", then on "Apodization of Pupil Transmission ". An
apodization of pupil transmission dialog box opens. This dialog
box has the radio button down for "No Apodization", so the pupil
transmission will be a simple top-hat function, i.e., 100%
everywhere in the pupil opening that is unobscured. Triangular
and circular or rectangular supergaussian apodization functions
are possible, as the dialog box shows. Click on the "Cancel"
button to close the apodization dialog box.
Click on the toplevel menu item "Setup", "Pupil
Transmission", then on "Obscuration of Pupil Transmission". An
obscuration of pupil transmission dialog box opens. For the
default setup, the pupil is unobscured (the 0.1 obscuration ratio
value is not used unless the "Central Obscuration" box is
checked). Similarly, the checkbox by "Struts" is unchecked, so
there are no shadows from struts. Click on the "Cancel" button
to close the obscuration dialog box.
Click on the toplevel menu item "Setup", "Pupil
Transmission", then on "Speckle". A speckle dialog box opens.
For the default setup, the pupil is unspeckled. Note that there
are radio buttons to select small, medium, or large speckles.
Click on the "Cancel" button to close the obscuration dialog box.
You've finished checking the input, i.e., specifying
everything about the exit pupil. Now let's look at how the output
will be shown and saved.
Click on the toplevel menu item "Setup", "Options", then
on "Analysis Options". An analysis options dialog box opens. It
has the checkbox marked for zooming-in on plots, and linear
plots of the PSF are selected (instead of logarithmic plots). If the
logarithmic plots feature were enabled, the program would plot
four decades of data; the number of decades is user selectable.
The program assumes that the object is infinitely distant. As a
result, the PSF can be output either in linear units on the focal
surface, or in terms of angles in object space. The pupil radius
is 20 "steps" or array elements, sometimes loosely called
"pixels". Click on the "Cancel" button to close the analysis
options dialog box.
Click on the toplevel menu item "Setup", "Options", then
on "Data Saving Options". An data saving options dialog box
opens. This dialog box has radio buttons to select whether the
save-file function will write out the pupil transmission, the pupil
phase, or the PSF modulus; the start-up configuration is to save
the PSF. Saving data to a file should occur quickly. Click on the
"Cancel" button to close the data saving options dialog box.
Click on the "View Plots" menu item. You'll see that there
are menu choices for the pupil transmission, the pupil phase
(wavefront), and the PSF. Click on the "Pupil Phase, 3-D"
submenu item. The wavefront phase that you see plotted on the
vertical axis is the combination (i.e., sum) of the familiar comatic
phase wavefront shape and the six lobed phase from the Zern
26 term that you saw turned on previously. The values for the
extent of x and y axes are labeled, and the units used are
millimeters. The RMS value of the wavefront OPD, in waves, is
shown above the plot. Click on "View Plots" and "Pupil Phase,
Contour" to see the contours of this wavefront. (You could click
on one of the PSF plots, but you would only get a message
saying that there is no PSF yet.) Click on "View Plots" and
"Pupil Transmission, 3-D" to see the transmission of this
wavefront; it is a flat-top with no central obscuration, nor strut
shadows.
(Whenever you run Abe_PSF2, it is probably a good idea
to look at the 3-D plots of pupil transmission and phase, as
you've just done, to be sure that your input is as you planned it
to be.)
Now for the fun; let's compute the point spread function
that results from this wavefront and look at it. Click on the
"Create PSF" menu item. A "doing FFT" cursor will appear while
the two dimensional fast Fourier transform (FFT) is performed to
compute the PSF. When the FFT processing is finished, a ding
sounds and a message box titled "FFT Statistics" opens. On a
486/66, the FFT takes about 0.8 seconds; on a 120 Mhz
Pentium, it's about 0.2 seconds. Click on "Okay" to close this
timer box (it only appears once per session). The "Create PSF"
menu item has been replaced with a grayed menu item that says
"FFT Done". Click on the menu item "View Plots", and click on
"PSF, 3-D". A 3-D plot of the PSF appears. The vertical (z) axis
of this plot is the normalized irradiance (power per unit area) of
the PSF corresponding to the wavefront with coma and the
phase from Zernike coefficient number 26; the x and y axes are
labeled in units of microns. The information above the plot
shows that the coma has caused the centroid of the spot to be
shifted 2.16 microns to the right of center. Click on the menu
items "View Plots" and "PSF, Contour" to see the contours of the
3-D PSF plot.
Congratulations! You've generated your first PSF, for an
unobscured pupil with coma and Zern 26 in it. There's plenty
more to play with.
Next, let's set up to look at the PSF of a perfect
wavefront. Click on the menu items "Setup", "Pupil Phase", and
"Third Order Aberrations", then click on the "Coma" checkbox
and the "X" that was there will disappear. You can leave the -0.4
number in the coma number field; when the checkbox is cleared,
no coma will be added to the wavefront because the number will
be ignored. Click on "Okay" (not "Cancel") to close the dialog
box. You'll see a cursor saying "MAKE WAVEFRONT" appear
while the new pupil function is generated, then disappear. Any
open windows are now outdated, so they are automatically
closed; the plots disappear. The grayed-out menu item that used
to say "FFT done" has changed; it now reads "Create PSF".
Similarly, use the "Setup", "Pupil Phase", and "Zernike
Coefficients" menu items to open the Zernike coefficients dialog
box, and to disable coefficient number 26. Close the Zernike
dialog box using the "OK" button. Click on "View Plots" and then
on the "Pupil Phase, 3-D" submenu item to see a flat plot that
signifies a perfect wavefront, and notice that the RMS wavefront
error is now essentially zero. Now it's time to generate the point
spread function for this perfect wavefront. In the top level menu,
click on "Create PSF" to do the FFT that will generate the new
PSF. Click on "View Plots" and then on the "PSF 3-D" submenu
item to see the perfect PSF's 3-D plot, and notice that the
centroid is also now essentially zero. Notice how symmetrical
the PSF is. Next, click on the "View Plots" and "PSF Contour"
submenu item, to see the perfect PSF's contour plots. Click on
the "View Plots" and "PSF, Y-Slice" submenu item, to see the
"rings" of the perfect PSF, i.e., the places near the peak where
the irradiance goes to zero.
There are still other features to play with. Go back to the
"Setup" menu item, and try other aberrations in different
amounts. Turn on the Zern 26 coefficient alone and do a 3-D
pupil phase plot to see what the Zern 26 aberration looks like.
Turn on the coma alone, and do another 3-D phase plot to see
what coma alone looks like. To change a value, double click on
the number (the data field changes color), then type in your
number and close the box. Remember that the checkbox next to
the number must be checked for the program to accept the
number. Redo the coma example with +0.4 waves instead of -
0.4 and look at the 3-D plot of the wavefront. Try 1 wave of
coma, and be sure to look at the PSF contour plot; looks familiar,
right? Or try 0.166 wave (peak, not RMS) of astigmatism
aberration combined with -1.0 waves of defocus; this will show
the PSF near the circle of least confusion; other amounts of
defocus will show either a vertical or horizontal line in the
contour plot. Try adding an obscuration, then use the "View
Plots" and "Pupil Transmission, 3-D" menu items to see the
obscuration in the middle of the pupil. Or model a system with
pupil gaussian apodization, and see that it gives a PSF without
diffraction rings. Try an 85% central obscuration on a perfect (no
aberrations or Zerns) wavefront and see how the diffraction rings
increase; try the strut obscuration option and see the "tails" that
show up in the PSF. Try a supergaussian coefficient of 6 or 8
and see a pupil transmission function that looks like a flat-top
with shoulders. Make the f/number smaller (make the optics
"faster") and you'll see the spot get smaller; notice the x and y
plot labels. Or try turning on the Zernike coefficients one at a
time, and look at the 3-D plot of the pupil wavefront phase.
Make the wavelength longer and watch the PSF size increase.
Look at the PSF plots in logarithmic units to see fine structure in
the outer diffraction rings. Or analyze 4 waves of spherical (the
Hubble problem). Or, for a perfect system, enable the
subaperture phase plate, with a half-wave of phase and with its
edge across the center of the aperture (the default) and see a
zero develop in the middle of the PSF. Try the larger 256 by 256
array size, or the 512 by 512 size; (this latter size may cause the
program to end on machines with insufficient memory).
If at any time you are unsure about what your wavefront
input is, look at the plots or the tables of the pupil transmission
and phase. If something looks funny, it may be because you've
forgotten to turn an aberration or transmission effect off.
_____ Section 4: History ____________________
Development of the Abe_PSF code began in mid-1995.
The first public release was version 3.6, in July of 1996. These
first versions were tested on a 66 Mhz `486 running Windows for
Workgroups 3.11, under Win32s for 32-bit operation, created
under Borland C++ version 4.52. When, in July 1997, the code
development computer was converted to Windows 95 and
Borland C++ ver 5.01, a number of bugs appeared. A character
array was dimensioned too small, and would cause aborts when
the centroid value on plots switched from fixed to exponential
format. The bugs have been fixed, and that was called
Abe_PSF is now called Abe_PSF2. The latest version of
Abe_PSF is version 2.0. It has been thoroughly tested on
Windows 95, but there may still be problems. If so, please
contact me at the address below.
_____ Section 5: Optics ____________________
If you're interested in optics, you're in good company,
from Newton to Einstein. If you want to learn more about optics,
I'd suggest a book called Fundamental of Optics by Jenkins and
White, for starters.
When you know enough about light to ask questions and
understand the answers, there's the sci.optics newsgroup on the
Internet. But like anything on the Internet, you would do well, in
my opinion, to look for backup on anything people tell you about
there.
There's a nice collection of optics software on
ftp://lorien.creol.ucf.edu.
For those considering a serious optics education, there's
the Institute of Optics at the University of Rochester, NY;
Georgia Tech, in Atlanta, GA; University of Arizona, in Tucson;
CREOL, UCF, in Orlando, FL, and Oregon Institute of
Technology in Klamath Falls.
________________________________________
I hope you have fun, and if you get something good out of
Abe_PSF2, please send in the $10 check; Baby needs new
chips.
Nelson Wallace
5734 Califa Place
Woodland Hills, CA 91367
User702495@aol.com